import autoImport from 'unplugin-auto-import/vite'

export default function createAutoImport() {
  return autoImport({
    imports: [
      'vue',
      'pinia',
      {
        dayjs: [['default', 'dayjs']],
      },
    ],
    dirs: [
      'src/hooks',
      'src/api/weChat',
      'src/api/weChatApplet',
      'src/api/business',
    ],
    dts: './generated/auto-import.d.ts',
    eslintrc: {
      enabled: true, // Default `false`
      filepath: './generated/.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
      globalsPropValue: true, // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
    },
  })
}
